using System;
using System.Globalization;
using System.Windows.Data;
using EventLogAnalyzer.Common;

namespace EventLogAnalyzer.View.Converter
{
    public class LogCountToHeightConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
          object parameter, CultureInfo culture)
        {
            if(value is int)
            {
                var scale = 200.0 / TemporaryValues.YAxisMaxValue ;
                return ((int)value) * scale;
            }
            return 0;
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, CultureInfo culture)
        {
            return null;
        }       
    }
}